import sqlite3

# 连接数据库
conn = sqlite3.connect('mydb.db')
# 创建游标
cursor = conn.cursor()

# 创建表
cursor.execute('''
    CREATE TABLE IF NOT EXISTS users (
        id INTEGER PRIMARY KEY AUTOINCREMENT,
        names TEXT,
        passwords TEXT
    )
''')

# 插入数据
#cursor.execute('INSERT INTO users (names, passwords) VALUES (?, ?)', ('张三', '25s12'))
data = [('李四', '51sda1'), ('王五', '84s8s14')]
cursor.execute("INSERT INTO users (names, passwords ) VALUES (?, ?)", ('王五', '84s8s14'))
conn.commit()

# 关闭连接
conn.close()
